import request from '@/utils/request'
import data from '@/utils/data'
// 登录
export function login(data) {
  return request({
    url: '/base/account/login',
    method: 'post',
    data
  })
}

// 退出
export function logout() {
  return request({
    url: '/base/account/loginOut',
    method: 'post'
  })
}
// 修改密码
export function editPwd(data) {
  return request({
    url: '/base/adminAccount/editPwd',
    method: 'post',
    data
  })
}

// 用户列表
export function editSysUser(data) {
  return request({
    url: '/user/editSysUser/page',
    method: 'post',
    data
  })
}
// 后台管理代理分页列表
export function queryFishPartyAgentPage(data) {
  return request({
    url: '/employe/fishPartyAgent/queryFishPartyAgentPage',
    method: 'post',
    data
  })
}
// 渔方列表
export function editFishParty(data) {
  return request({
    url: '/fish-party/editFishParty/page',
    method: 'post',
    data
  })
}
// 渔方详情
export function FishParty(data) {
  return request({
    url: '/fish-party/editFishParty/detail?fishPartyId=' + data.fishPartyId + '&orderId=' + data.orderId,
    method: 'get'
  })
}
// 渔方详情计算鱼苗重量
export function calculateFryWeight(data) {
  return request({
    url: '/fish-party/editFishParty/calculateFryWeight?fishPartyId=' + data.fishPartyId + '&fryId=' + data.fryId+'&launchedDay=' + data.launchedDay,
    method: 'get'
  })
}
// 水库列表
export function reservoir(data) {
  return request({
    url: '/base/edit/reservoir/page',
    method: 'post',
    data
  })
}
// 水库详情
export function detail(data) {
  return request({
    url: '/base/edit/reservoir/detail?reservoirId=' + data.reservoirId,
    method: 'post',
    data
  })
}
// 更新水库启用状态
export function updateStatus(data) {
  return request({
    url: '/base/edit/reservoir/updateStatus?reservoirId=' + data.reservoirId + "&status=" + data.status,
    method: 'post'
  })
}
// 水库上下移动排序
export function moveRandomSort(data) {
  return request({
    url: '/base/edit/reservoir/moveRandomSort',
    method: 'post',
    data
  })
}
// 添加默认水库
export function addRandomPage(data) {
  return request({
    url: '/base/edit/reservoir/addRandomPage?randomSort=' + data.randomSort + '&reservoirId='+ data.reservoirId,
    method: 'get'
  })
}
// 移除默认水库
export function removeRandomPage(data) {
  return request({
    url: '/base/edit/reservoir/removeRandomPage?reservoirId='+ data.reservoirId,
    method: 'get'
  })
}
// 鱼苗投放工单分页
export function fryLaunchWork(data) {
  return request({
    url: '/fish-party/fryLaunchWork/page',
    method: 'post',
    data
  })
}
// 删除鱼苗工单
export function removeByIdFish(data) {
  return request({
    url: '/fish-party/fryLaunchWork/removeById?workOrderId=' + data.workOrderId,
    method: 'post',
  })
}
// 发票工单分页
export function invoiceRecord(data) {
  return request({
    url: '/payment/invoiceRecord/page',
    method: 'post',
    data
  })
}
// 订单列表分页
export function editFishPartyOrder(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/page',
    method: 'post',
    data
  })
}
// 关闭订单
export function closeOrder(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/closeOrder?orderId=' + data.orderId + '&remark=' + data.remark,
    method: 'post'
  })
}
// 备注订单
export function updateRemark(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/updateRemark?orderId=' + data.orderId + '&remark=' + data.remark,
    method: 'post'
  })
}
// 轮播分页数据
export function bannerConfig(data) {
  return request({
    url: '/base/bannerConfig/page',
    method: 'POST',
    data
  })
}
// 添加轮播数据
export function bannerConfigAdd(data) {
  return request({
    url: '/base/bannerConfig/add',
    method: 'POST',
    data
  })
}
// 更新轮播数据
export function bannerConfigUpdate(data) {
  return request({
    url: '/base/bannerConfig/update',
    method: 'POST',
    data
  })
}
// 删除轮播数据
export function bannerConfigRemove(data) {
  return request({
    url: '/base/bannerConfig/remove?id='+ data.id,
    method: 'POST'
  })
}
// 修改轮播分页状态
export function CarouselUpdate(data) {
  return request({
    url: '/base/bannerConfig/updateEnableStatus?enableStatus=' + data.enableStatus + '&id=' + data.id,
    method: 'POST'
  })
}
// 根据ID查找轮播数据
export function getById(data) {
  return request({
    url: '/base/bannerConfig/getById?id='  + data.id,
    method: 'get'
  })
}
// 鱼苗分页信息
export function fryInfo(data) {
  return request({
    url: '/fish-party/fryInfo/page',
    method: 'post',
    data
  })
}
// 鱼苗列表 
export function fryInfoList() {
  return request({
    url: '/fish-party/fryInfo/list',
    method: 'get',
  })
}
// 根据ID查找鱼苗数据
export function fryInfoGetFryById(data) {
  return request({
    url: '/fish-party/fryInfo/getFryById?id=' + data.id,
    method: 'get',
  })
}
// 鱼苗更改启用状态
export function updateEnableStatus(data) {
  return request({
    url: '/fish-party/fryInfo/updateEnableStatus?enableStatus=' + data.enableStatus + '&id=' + data.id,
    method: 'post'
  })
}
// 编辑 鱼苗信息
export function fryInfoUpdate(data) {
  return request({
    url: '/fish-party/fryInfo/update',
    method: 'post',
    data
  })
}
// 删除鱼苗信息
export function fryInfoRemove(data) {
  return request({
    url: '/fish-party/fryInfo/remove?id=' + data.id,
    method: 'post'
  })
}
// 根据用户ID获取用户信息
export function getUserById(data) {
  return request({
    url: '/user/sysUser/getUserById?userId=' + data.userId,
    method: 'post'
  })
}

// 根据水库查询鱼苗信息
export function getReservoirFry(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/getReservoirFry?fryNature=' + data.fryNature + "&reservoirId=" + data.reservoirId,
    method: 'post'
  })
}

// 后台录单
export function createOrder(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/createOrder',
    method: 'post',
    data
  })
}

// 上传文件
export function uploadFileToOss(formData) {
  return request({
    url: '/file/oss/uploadFileToOss',
    method: 'post',
    data:formData
  })
}
// 鱼苗详情
export function orderDetail(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/orderDetail?orderId=' + data.orderId,
    method: 'get',
  })
}
// 修改用户信息
export function updateUserInfo(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/updateUserInfo?orderId=' + data.orderId + '&phoneNumber='+ data.phoneNumber + '&email=' + data.email + '&remark=' + data.remark,
    method: 'post'
  })
}
// 添加用户
export function addUser(data) {
  return request({
    url: '/user/editSysUser/addUser',
    method: 'post',
    data
  })
}
// 用户详情
export function editSysUserDetail(data) {
  return request({
    url: '/user/editSysUser/detail?userId=' + data.userId,
    method: 'post'
  })
}

// 鱼苗投放工单导出
export function exportFryWorkOrderExcel(data) {
  return request({
    url: '/file/export/exportFryWorkOrderExcel',
    method: 'post',
    data
  })
}
// 发票列表导出
export function exportInvoiceExcel(data) {
  return request({
    url: '/file/export/exportInvoiceExcel',
    method: 'post',
    data
  })
}
// 水库列表导出
export function exportReservoirExcell(data) {
  return request({
    url: '/file/export/exportReservoirExcel',
    method: 'post',
    data
  })
}
// 渔方监控设备信息导入
export function importFishPartyMonitor(formData) {
  return request({
    url: '/file/export/importFishPartyMonitor',
    method: 'post',
    data:formData
    
  })
}
// 渔方监控设备信息导入
export function importFishPartyFeedNo(formData) {
  return request({
    url: '/file/export/importFishPartyFeedNo',
    method: 'post',
    data:formData
    
  })
}
// 智能渔方租赁订单列表导出
export function exportFishPartyOrderExcel(data) {
  return request({
    url: '/file/export/exportFishPartyOrderExcel',
    method: 'post',
    data
    
  })
}
// 智能渔方代理列表导出
export function exportFishPartyAgentExcel(data) {
  return request({
    url: '/file/export/exportFishPartyAgentExcel',
    method: 'post',
    data
    
  })
}
// 鱼苗工单-投放鱼苗
export function lunchFry(data) {
  return request({
    url: '/fish-party/fryLaunchWork/lunchFry',
    method: 'post',
    data
  })
}
// 添加鱼苗数据
export function addFryInfo(data) {
  return request({
    url: '/fish-party/fryInfo/add',
    method: 'post',
    data
  })
}
// 查询城市列表
export function queryList() {
  return request({
    url: '/base/cityInfo/queryList',
    method: 'get'
  })
}
// 保存水库
export function addSave(data) {
  return request({
    url: '/base/edit/reservoir/save',
    method: 'post',
    data
  })
}

// 修改发票状态
export function openStatus(data) {
  return request({
    url: '/payment/invoiceRecord/updateStatus?id='+ data.id + '&status=' + data.status,
    method: 'post'
  })
}
// 根据用户ID查询智能渔方代理
export function getAgentByUserId(data) {
  return request({
    url: '/employe/fishPartyAgent/getAgentByUserId?userId='+ data.userId,
    method: 'get'
  })
}
// 更改用户启用/禁用状态
export function userStatus(data) {
  return request({
    url: '/user/editSysUser/updateEnableStatus?enableStatus='+ data.enableStatus + '&userId='+ data.userId,
    method: 'post'
  })
}
// 删除用户
export function removeById(data) {
  return request({
    url: '/user/editSysUser/removeById?userId='+ data.userId,
    method: 'post'
  })
}
// 部门分页
export function department(data) {
  return request({
    url: '/base/department/page',
    method: 'post',
    data
  })
}
export function departmentList() {
  return request({
    url: '/base/department/list',
    method: 'get',
  })
}
// 保存/编辑部门
export function departmentSave(data) {
  return request({
    url: '/base/department/save',
    method: 'post',
    data
  })
}
//更改部门启用状态
export function departmentuPdateStatus(data) {
  return request({
    url: '/base/department/updateStatus?departmentId=' + data.departmentId + '&status=' + data.status,
    method: 'post'
  })
}
//删除部门
export function departmentuRemove(data) {
  return request({
    url: '/base/department/remove?departmentId=' + data.departmentId,
    method: 'post'
  })
}
// 查询部门接口权限
export function getDepartmentPermission(data) {
  return request({
    url: '/base/department/getDepartmentPermission?departmentId=' + data.departmentId,
    method: 'get'
  })
}
// 账号成员列表
export function adminAccount(data) {
  return request({
    url: '/base/adminAccount/page',
    method: 'post',
    data
  })
}
// 保存/编辑用户
export function adminAccountSave(data) {
  return request({
    url: '/base/adminAccount/save',
    method: 'post',
    data
  })
}
// 保存部门权限
export function departmentJurisdiction(data) {
  return request({
    url: '/base/department/saveDepartmentPermission',
    method: 'post',
    data
  })
}
// 删除成员
export function adminAccountRemove(data) {
  return request({
    url: '/base/adminAccount/remove?accountId=' + data.accountId,
    method: 'post'
  })
}
// 更改成员启用状态
export function adminAccountStatus(data) {
  return request({
    url: '/base/adminAccount/updateStatus?accountId=' + data.accountId + '&status=' + data.status,
    method: 'post'
  })
}
// 查询登录日志分页
export function loginRecordPage(data) {
  return request({
    url: '/base/account/loginRecordPage',
    method: 'post',
    data
  })
}
// 查询账户权限
export function getAccountPermission(data) {
  return request({
    url: '/base/adminAccount/getAccountPermission?accountId=' + data.accountId,
    method: 'get'
  })
}
// 保存账号权限
export function openSaveAccountPermission(data) {
  return request({
    url: '/base/adminAccount/saveAccountPermission',
    method: 'post',
    data
  })
}
// 
// 获取默认水库列表
export function randomPage() {
  return request({
    url: '/base/edit/reservoir/randomPage',
    method: 'GET'
  })
}
// 保存渔方
export function editFishPartyave(data) {
  return request({
    url: '/fish-party/editFishParty/save',
    method: 'post',
    data
  })
}
// 代理商的客户分页列表
export function agentCustomer(data) {
  return request({
    url: '/marketing/agentCustomer/page',
    method: 'post',
    data
  })
}
// 解除客户锁定
export function relieveCustomerLock(data) {
  return request({
    url: '/marketing/agentCustomer/relieveCustomerLock?agentUserId=' + data.agentUserId + '&customerUserId=' + data.customerUserId,
    method: 'post'
  })
}
// 鱼米记录分页
export function getWalletRecord(data) {
  return request({
    url: '/user/editSysUser/getWalletRecord',
    method: 'post',
    data
  })
}
// 修改基本信息
export function updateBaseInfo(data) {
  return request({
    url: '/fish-party/editFishPartyOrder/updateBaseInfo',
    method: 'post',
    data
  })
}
// 配置渔方信息
export function configureFishPart(data) {
  return request({
    url: '/fish-party/editFishParty/configureFishPart',
    method: 'post',
    data
  })
}
// 配置投喂时间段
export function saveFishPartyFeedTime(data) {
  return request({
    url: '/fish-party/editFishParty/editFishParty/saveFishPartyFeedTime',
    method: 'post',
    data
  })
}
// 智能渔方保单分页
export function fishPartyPolicy(data) {
  return request({
    url: '/fish-party/fishPartyPolicy/page',
    method: 'post',
    data
  })
}
// 保存智能渔方保单
export function fishPartyPolicySave(data) {
  return request({
    url: '/fish-party/fishPartyPolicy/save',
    method: 'post',
    data
  })
}
// 保存智能渔方保单
export function fishPartyPolicyRemove(data) {
  return request({
    url: '/fish-party/fishPartyPolicy/removeById?id='+ data.id,
    method: 'post'
  })
}